using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VLRKOPF
    {
        public DataRow Convert2LRKOPF(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryLRKOPF(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["LRKMANDANT"] = " ".PadRight(2 ); 
         dwReturn["LRKREZART"] = " ".PadRight(1 ); 
         dwReturn["LRKREZNR"] = " ".PadRight(10 ); 
         dwReturn["LRKREZST"] = " ".PadRight(1 ); 
         dwReturn["LRKWERK"] = " ".PadRight(3 ); 
         dwReturn["LRKABT"] = " ".PadRight(3 ); 
         dwReturn["LRKVSTUFE"] = " ".PadRight(1 ); 
         dwReturn["LRKBEZ"] = " ".PadRight(40 ); 
         dwReturn["LRKTYP"] = " ".PadRight(1 ); 
         dwReturn["LRKGRUPPE"] = " ".PadRight(10 ); 
         dwReturn["LRKMTYP"] = " ".PadRight(8 ); 
         dwReturn["LRKKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["LRKFARBE"] = " ".PadRight(10 ); 
         dwReturn["LRKDESS"] = " ".PadRight(10 ); 
         dwReturn["LRKCOLORIT"] = " ".PadRight(10 ); 
         dwReturn["LRKKATFARBE"] = " ".PadRight(10 ); 
         dwReturn["LRKWDOS"] = " ".PadRight(0 ); 
         dwReturn["LRKDOSI"] = " ".PadRight(0 ); 
         dwReturn["LRKTZEIT"] = " ".PadRight(0 ); 
         dwReturn["LRKVERLUST"] = " ".PadRight(0 ); 
         dwReturn["LRKSCHLIGR1"] = " ".PadRight(1 ); 
         dwReturn["LRKSCHLIGR2"] = " ".PadRight(1 ); 
         dwReturn["LRKSCHLIGR3"] = " ".PadRight(1 ); 
         dwReturn["LRKSCHLIGR4"] = " ".PadRight(1 ); 
         dwReturn["LRKSCHLIGR5"] = " ".PadRight(1 ); 
         dwReturn["LRKSCHLINR1"] = " ".PadRight(3 ); 
         dwReturn["LRKSCHLINR2"] = " ".PadRight(3 ); 
         dwReturn["LRKSCHLINR3"] = " ".PadRight(3 ); 
         dwReturn["LRKSCHLINR4"] = " ".PadRight(3 ); 
         dwReturn["LRKSCHLINR5"] = " ".PadRight(3 ); 
         dwReturn["LRKTEMP"] = " ".PadRight(0 ); 
         dwReturn["LRKPH"] = " ".PadRight(0 ); 
         dwReturn["LRKKOIMTR"] = " ".PadRight(0 ); 
         dwReturn["LRKKOIMIN"] = " ".PadRight(0 ); 
         dwReturn["LRKWAMENGE"] = " ".PadRight(0 ); 
         dwReturn["LRKKAMENGE"] = " ".PadRight(0 ); 
         dwReturn["LRKBEM"] = " ".PadRight(45 ); 
         dwReturn["LRKDRKZ1"] = " ".PadRight(1 ); 
         dwReturn["LRKDRKZ2"] = " ".PadRight(1 ); 
         dwReturn["LRKDRKZ3"] = " ".PadRight(1 ); 
         dwReturn["LRKSPERRE"] = " ".PadRight(6 ); 
         dwReturn["LRKANZPART"] = " ".PadRight(1 ); 
         dwReturn["LRKANZPARTP"] = " ".PadRight(1 ); 
         dwReturn["LRKWAKZ"] = " ".PadRight(1 ); 
         dwReturn["LRKART"] = " ".PadRight(21 ); 
         dwReturn["LRKVAR"] = " ".PadRight(3 ); 
         dwReturn["LRKCOLORKZ"] = " ".PadRight(1 ); 
         dwReturn["LRKPROZ"] = " ".PadRight(8 ); 
         dwReturn["LRKVERF"] = " ".PadRight(10 ); 
         dwReturn["LRKPROTO"] = " ".PadRight(10 ); 
         dwReturn["LRKMETHODE"] = " ".PadRight(4 ); 
         dwReturn["LRKKORRTAB"] = " ".PadRight(8 ); 
         dwReturn["LRKTOLFRML"] = " ".PadRight(9 ); 
         dwReturn["LRKTOLBL"] = " ".PadRight(8 ); 
         dwReturn["LRKLIART1"] = " ".PadRight(5 ); 
         dwReturn["LRKTOLFKT1"] = " ".PadRight(0 ); 
         dwReturn["LRKLIART2"] = " ".PadRight(5 ); 
         dwReturn["LRKTOLFKT2"] = " ".PadRight(0 ); 
         dwReturn["LRKLIART3"] = " ".PadRight(5 ); 
         dwReturn["LRKTOLFKT3"] = " ".PadRight(0 ); 
         dwReturn["LRKLIART4"] = " ".PadRight(5 ); 
         dwReturn["LRKTOLFKT4"] = " ".PadRight(0 ); 
         dwReturn["LRKFLOMIN"] = " ".PadRight(0 ); 
         dwReturn["LRKFLOOPT"] = " ".PadRight(0 ); 
         dwReturn["LRKFLOMAX"] = " ".PadRight(0 ); 
         dwReturn["LRKFLOAUF"] = " ".PadRight(0 ); 
         dwReturn["LRKFLOVST"] = " ".PadRight(0 ); 
         dwReturn["LRKLECHT"] = " ".PadRight(0 ); 
         dwReturn["LRKNECHT"] = " ".PadRight(0 ); 
         dwReturn["LRKVERSART"] = " ".PadRight(1 ); 
         dwReturn["LRKFARBBEZ"] = " ".PadRight(20 ); 
         dwReturn["LRKDRKBRT"] = " ".PadRight(0 ); 
         dwReturn["LRKLRAND"] = " ".PadRight(0 ); 
         dwReturn["LRKRRAND"] = " ".PadRight(0 ); 
         dwReturn["LRKPROGRP"] = " ".PadRight(3 ); 
         dwReturn["LRKARTGRP"] = " ".PadRight(3 ); 
         dwReturn["LRKKONZVON"] = " ".PadRight(0 ); 
         dwReturn["LRKKONZZU"] = " ".PadRight(0 ); 
         dwReturn["LRKNACH"] = " ".PadRight(0 ); 
         dwReturn["LRKFLOAUFM"] = " ".PadRight(1 ); 
         dwReturn["LRKFKKG"] = " ".PadRight(0 ); 
         dwReturn["LRKCKKG"] = " ".PadRight(0 ); 
         dwReturn["LRKFKLTR"] = " ".PadRight(0 ); 
         dwReturn["LRKCKLTR"] = " ".PadRight(0 ); 
         dwReturn["LRKFKMIN"] = " ".PadRight(0 ); 
         dwReturn["LRKCKMIN"] = " ".PadRight(0 ); 
         dwReturn["LRKFIXIERFL"] = " ".PadRight(0 ); 
         dwReturn["LRKBEARBZT"] = " ".PadRight(0 ); 
         dwReturn["LRKGRUNDMG"] = " ".PadRight(0 ); 
         dwReturn["LRKSPEZGEW"] = " ".PadRight(0 ); 
         dwReturn["LRKTRKSUBST"] = " ".PadRight(0 ); 
         dwReturn["LRKREIFEZT"] = " ".PadRight(0 ); 
         dwReturn["LRKMNRKRS"] = " ".PadRight(2 ); 
         dwReturn["LRKMLFDNR"] = " ".PadRight(4 ); 
         dwReturn["LRKMPOS"] = " ".PadRight(2 ); 
         dwReturn["LRKFKMTR"] = " ".PadRight(0 ); 
         dwReturn["LRKCKMTR"] = " ".PadRight(0 ); 
         dwReturn["LRKRGBWERT1"] = " ".PadRight(0 ); 
         dwReturn["LRKRGBWERT2"] = " ".PadRight(0 ); 
         dwReturn["LRKRGBWERT3"] = " ".PadRight(0 ); 
         dwReturn["LRKFARBPAL"] = " ".PadRight(3 ); 
         dwReturn["LRKFLKZ"] = " ".PadRight(1 ); 
         dwReturn["LRKFILLER2"] = " ".PadRight(50 ); 
         dwReturn["LRKLAUFKRS"] = " ".PadRight(2 ); 
         dwReturn["LRKLAUFLFD"] = " ".PadRight(6 ); 
         dwReturn["LRKLAUFPOS"] = " ".PadRight(3 ); 
         dwReturn["LRKVERS"] = " ".PadRight(0 ); 
         dwReturn["LRKAENDZL"] = " ".PadRight(0 ); 
         dwReturn["LRKAENDBEN"] = " ".PadRight(8 ); 
         dwReturn["LRKAENDDAT"] = " ".PadRight(0 ); 
         dwReturn["LRKNEUBEN"] = " ".PadRight(8 ); 
         dwReturn["LRKNEUDAT"] = " ".PadRight(0 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapLRKOPF(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveLRKOPF(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryLRKOPF(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapLRKOPF(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertLRKOPF(dwLocal, ITXDBVERSION);
            }
            UpdateLRKOPF(dwLocal);
        }
        public void InsertLRKOPF(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO LRKOPF(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryLRKOPF(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM LRKOPF WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM LRKOPF  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "LRKOPF";
            Return = Result;
            return Return;
        }
        public void DeleteLRKOPF(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM LRKOPF   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateLRKOPF(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE LRKOPF SET "
                    +"LRKMANDANT= :LRKMANDANT,"
                    +"LRKREZART= :LRKREZART,"
                    +"LRKREZNR= :LRKREZNR,"
                    +"LRKREZST= :LRKREZST,"
                    +"LRKWERK= :LRKWERK,"
                    +"LRKABT= :LRKABT,"
                    +"LRKVSTUFE= :LRKVSTUFE,"
                    +"LRKBEZ= :LRKBEZ,"
                    +"LRKTYP= :LRKTYP,"
                    +"LRKGRUPPE= :LRKGRUPPE,"
                    +"LRKMTYP= :LRKMTYP,"
                    +"LRKKUNDNR= :LRKKUNDNR,"
                    +"LRKFARBE= :LRKFARBE,"
                    +"LRKDESS= :LRKDESS,"
                    +"LRKCOLORIT= :LRKCOLORIT,"
                    +"LRKKATFARBE= :LRKKATFARBE,"
                    +"LRKWDOS= :LRKWDOS,"
                    +"LRKDOSI= :LRKDOSI,"
                    +"LRKTZEIT= :LRKTZEIT,"
                    +"LRKVERLUST= :LRKVERLUST,"
                    +"LRKSCHLIGR1= :LRKSCHLIGR1,"
                    +"LRKSCHLIGR2= :LRKSCHLIGR2,"
                    +"LRKSCHLIGR3= :LRKSCHLIGR3,"
                    +"LRKSCHLIGR4= :LRKSCHLIGR4,"
                    +"LRKSCHLIGR5= :LRKSCHLIGR5,"
                    +"LRKSCHLINR1= :LRKSCHLINR1,"
                    +"LRKSCHLINR2= :LRKSCHLINR2,"
                    +"LRKSCHLINR3= :LRKSCHLINR3,"
                    +"LRKSCHLINR4= :LRKSCHLINR4,"
                    +"LRKSCHLINR5= :LRKSCHLINR5,"
                    +"LRKTEMP= :LRKTEMP,"
                    +"LRKPH= :LRKPH,"
                    +"LRKKOIMTR= :LRKKOIMTR,"
                    +"LRKKOIMIN= :LRKKOIMIN,"
                    +"LRKWAMENGE= :LRKWAMENGE,"
                    +"LRKKAMENGE= :LRKKAMENGE,"
                    +"LRKBEM= :LRKBEM,"
                    +"LRKDRKZ1= :LRKDRKZ1,"
                    +"LRKDRKZ2= :LRKDRKZ2,"
                    +"LRKDRKZ3= :LRKDRKZ3,"
                    +"LRKSPERRE= :LRKSPERRE,"
                    +"LRKANZPART= :LRKANZPART,"
                    +"LRKANZPARTP= :LRKANZPARTP,"
                    +"LRKWAKZ= :LRKWAKZ,"
                    +"LRKART= :LRKART,"
                    +"LRKVAR= :LRKVAR,"
                    +"LRKCOLORKZ= :LRKCOLORKZ,"
                    +"LRKPROZ= :LRKPROZ,"
                    +"LRKVERF= :LRKVERF,"
                    +"LRKPROTO= :LRKPROTO,"
                    +"LRKMETHODE= :LRKMETHODE,"
                    +"LRKKORRTAB= :LRKKORRTAB,"
                    +"LRKTOLFRML= :LRKTOLFRML,"
                    +"LRKTOLBL= :LRKTOLBL,"
                    +"LRKLIART1= :LRKLIART1,"
                    +"LRKTOLFKT1= :LRKTOLFKT1,"
                    +"LRKLIART2= :LRKLIART2,"
                    +"LRKTOLFKT2= :LRKTOLFKT2,"
                    +"LRKLIART3= :LRKLIART3,"
                    +"LRKTOLFKT3= :LRKTOLFKT3,"
                    +"LRKLIART4= :LRKLIART4,"
                    +"LRKTOLFKT4= :LRKTOLFKT4,"
                    +"LRKFLOMIN= :LRKFLOMIN,"
                    +"LRKFLOOPT= :LRKFLOOPT,"
                    +"LRKFLOMAX= :LRKFLOMAX,"
                    +"LRKFLOAUF= :LRKFLOAUF,"
                    +"LRKFLOVST= :LRKFLOVST,"
                    +"LRKLECHT= :LRKLECHT,"
                    +"LRKNECHT= :LRKNECHT,"
                    +"LRKVERSART= :LRKVERSART,"
                    +"LRKFARBBEZ= :LRKFARBBEZ,"
                    +"LRKDRKBRT= :LRKDRKBRT,"
                    +"LRKLRAND= :LRKLRAND,"
                    +"LRKRRAND= :LRKRRAND,"
                    +"LRKPROGRP= :LRKPROGRP,"
                    +"LRKARTGRP= :LRKARTGRP,"
                    +"LRKKONZVON= :LRKKONZVON,"
                    +"LRKKONZZU= :LRKKONZZU,"
                    +"LRKNACH= :LRKNACH,"
                    +"LRKFLOAUFM= :LRKFLOAUFM,"
                    +"LRKFKKG= :LRKFKKG,"
                    +"LRKCKKG= :LRKCKKG,"
                    +"LRKFKLTR= :LRKFKLTR,"
                    +"LRKCKLTR= :LRKCKLTR,"
                    +"LRKFKMIN= :LRKFKMIN,"
                    +"LRKCKMIN= :LRKCKMIN,"
                    +"LRKFIXIERFL= :LRKFIXIERFL,"
                    +"LRKBEARBZT= :LRKBEARBZT,"
                    +"LRKGRUNDMG= :LRKGRUNDMG,"
                    +"LRKSPEZGEW= :LRKSPEZGEW,"
                    +"LRKTRKSUBST= :LRKTRKSUBST,"
                    +"LRKREIFEZT= :LRKREIFEZT,"
                    +"LRKMNRKRS= :LRKMNRKRS,"
                    +"LRKMLFDNR= :LRKMLFDNR,"
                    +"LRKMPOS= :LRKMPOS,"
                    +"LRKFKMTR= :LRKFKMTR,"
                    +"LRKCKMTR= :LRKCKMTR,"
                    +"LRKRGBWERT1= :LRKRGBWERT1,"
                    +"LRKRGBWERT2= :LRKRGBWERT2,"
                    +"LRKRGBWERT3= :LRKRGBWERT3,"
                    +"LRKFARBPAL= :LRKFARBPAL,"
                    +"LRKFLKZ= :LRKFLKZ,"
                    +"LRKFILLER2= :LRKFILLER2,"
                    +"LRKLAUFKRS= :LRKLAUFKRS,"
                    +"LRKLAUFLFD= :LRKLAUFLFD,"
                    +"LRKLAUFPOS= :LRKLAUFPOS,"
                    +"LRKVERS= :LRKVERS,"
                    +"LRKAENDZL= :LRKAENDZL,"
                    +"LRKAENDBEN= :LRKAENDBEN,"
                    +"LRKAENDDAT= :LRKAENDDAT,"
                    +"LRKNEUBEN= :LRKNEUBEN,"
                    +"LRKNEUDAT= :LRKNEUDAT,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("LRKMANDANT", OracleType.NVarChar).Value = dwData["LRKMANDANT"].ToString(); 
          or1.Parameters.Add("LRKREZART", OracleType.NVarChar).Value = dwData["LRKREZART"].ToString(); 
          or1.Parameters.Add("LRKREZNR", OracleType.NVarChar).Value = dwData["LRKREZNR"].ToString(); 
          or1.Parameters.Add("LRKREZST", OracleType.NVarChar).Value = dwData["LRKREZST"].ToString(); 
          or1.Parameters.Add("LRKWERK", OracleType.NVarChar).Value = dwData["LRKWERK"].ToString(); 
          or1.Parameters.Add("LRKABT", OracleType.NVarChar).Value = dwData["LRKABT"].ToString(); 
          or1.Parameters.Add("LRKVSTUFE", OracleType.NVarChar).Value = dwData["LRKVSTUFE"].ToString(); 
          or1.Parameters.Add("LRKBEZ", OracleType.NVarChar).Value = dwData["LRKBEZ"].ToString(); 
          or1.Parameters.Add("LRKTYP", OracleType.NVarChar).Value = dwData["LRKTYP"].ToString(); 
          or1.Parameters.Add("LRKGRUPPE", OracleType.NVarChar).Value = dwData["LRKGRUPPE"].ToString(); 
          or1.Parameters.Add("LRKMTYP", OracleType.NVarChar).Value = dwData["LRKMTYP"].ToString(); 
          or1.Parameters.Add("LRKKUNDNR", OracleType.NVarChar).Value = dwData["LRKKUNDNR"].ToString(); 
          or1.Parameters.Add("LRKFARBE", OracleType.NVarChar).Value = dwData["LRKFARBE"].ToString(); 
          or1.Parameters.Add("LRKDESS", OracleType.NVarChar).Value = dwData["LRKDESS"].ToString(); 
          or1.Parameters.Add("LRKCOLORIT", OracleType.NVarChar).Value = dwData["LRKCOLORIT"].ToString(); 
          or1.Parameters.Add("LRKKATFARBE", OracleType.NVarChar).Value = dwData["LRKKATFARBE"].ToString(); 
          or1.Parameters.Add("LRKWDOS", OracleType.NVarChar).Value = dwData["LRKWDOS"].ToString(); 
          or1.Parameters.Add("LRKDOSI", OracleType.NVarChar).Value = dwData["LRKDOSI"].ToString(); 
          or1.Parameters.Add("LRKTZEIT", OracleType.NVarChar).Value = dwData["LRKTZEIT"].ToString(); 
          or1.Parameters.Add("LRKVERLUST", OracleType.NVarChar).Value = dwData["LRKVERLUST"].ToString(); 
          or1.Parameters.Add("LRKSCHLIGR1", OracleType.NVarChar).Value = dwData["LRKSCHLIGR1"].ToString(); 
          or1.Parameters.Add("LRKSCHLIGR2", OracleType.NVarChar).Value = dwData["LRKSCHLIGR2"].ToString(); 
          or1.Parameters.Add("LRKSCHLIGR3", OracleType.NVarChar).Value = dwData["LRKSCHLIGR3"].ToString(); 
          or1.Parameters.Add("LRKSCHLIGR4", OracleType.NVarChar).Value = dwData["LRKSCHLIGR4"].ToString(); 
          or1.Parameters.Add("LRKSCHLIGR5", OracleType.NVarChar).Value = dwData["LRKSCHLIGR5"].ToString(); 
          or1.Parameters.Add("LRKSCHLINR1", OracleType.NVarChar).Value = dwData["LRKSCHLINR1"].ToString(); 
          or1.Parameters.Add("LRKSCHLINR2", OracleType.NVarChar).Value = dwData["LRKSCHLINR2"].ToString(); 
          or1.Parameters.Add("LRKSCHLINR3", OracleType.NVarChar).Value = dwData["LRKSCHLINR3"].ToString(); 
          or1.Parameters.Add("LRKSCHLINR4", OracleType.NVarChar).Value = dwData["LRKSCHLINR4"].ToString(); 
          or1.Parameters.Add("LRKSCHLINR5", OracleType.NVarChar).Value = dwData["LRKSCHLINR5"].ToString(); 
          or1.Parameters.Add("LRKTEMP", OracleType.NVarChar).Value = dwData["LRKTEMP"].ToString(); 
          or1.Parameters.Add("LRKPH", OracleType.NVarChar).Value = dwData["LRKPH"].ToString(); 
          or1.Parameters.Add("LRKKOIMTR", OracleType.NVarChar).Value = dwData["LRKKOIMTR"].ToString(); 
          or1.Parameters.Add("LRKKOIMIN", OracleType.NVarChar).Value = dwData["LRKKOIMIN"].ToString(); 
          or1.Parameters.Add("LRKWAMENGE", OracleType.NVarChar).Value = dwData["LRKWAMENGE"].ToString(); 
          or1.Parameters.Add("LRKKAMENGE", OracleType.NVarChar).Value = dwData["LRKKAMENGE"].ToString(); 
          or1.Parameters.Add("LRKBEM", OracleType.NVarChar).Value = dwData["LRKBEM"].ToString(); 
          or1.Parameters.Add("LRKDRKZ1", OracleType.NVarChar).Value = dwData["LRKDRKZ1"].ToString(); 
          or1.Parameters.Add("LRKDRKZ2", OracleType.NVarChar).Value = dwData["LRKDRKZ2"].ToString(); 
          or1.Parameters.Add("LRKDRKZ3", OracleType.NVarChar).Value = dwData["LRKDRKZ3"].ToString(); 
          or1.Parameters.Add("LRKSPERRE", OracleType.NVarChar).Value = dwData["LRKSPERRE"].ToString(); 
          or1.Parameters.Add("LRKANZPART", OracleType.NVarChar).Value = dwData["LRKANZPART"].ToString(); 
          or1.Parameters.Add("LRKANZPARTP", OracleType.NVarChar).Value = dwData["LRKANZPARTP"].ToString(); 
          or1.Parameters.Add("LRKWAKZ", OracleType.NVarChar).Value = dwData["LRKWAKZ"].ToString(); 
          or1.Parameters.Add("LRKART", OracleType.NVarChar).Value = dwData["LRKART"].ToString(); 
          or1.Parameters.Add("LRKVAR", OracleType.NVarChar).Value = dwData["LRKVAR"].ToString(); 
          or1.Parameters.Add("LRKCOLORKZ", OracleType.NVarChar).Value = dwData["LRKCOLORKZ"].ToString(); 
          or1.Parameters.Add("LRKPROZ", OracleType.NVarChar).Value = dwData["LRKPROZ"].ToString(); 
          or1.Parameters.Add("LRKVERF", OracleType.NVarChar).Value = dwData["LRKVERF"].ToString(); 
          or1.Parameters.Add("LRKPROTO", OracleType.NVarChar).Value = dwData["LRKPROTO"].ToString(); 
          or1.Parameters.Add("LRKMETHODE", OracleType.NVarChar).Value = dwData["LRKMETHODE"].ToString(); 
          or1.Parameters.Add("LRKKORRTAB", OracleType.NVarChar).Value = dwData["LRKKORRTAB"].ToString(); 
          or1.Parameters.Add("LRKTOLFRML", OracleType.NVarChar).Value = dwData["LRKTOLFRML"].ToString(); 
          or1.Parameters.Add("LRKTOLBL", OracleType.NVarChar).Value = dwData["LRKTOLBL"].ToString(); 
          or1.Parameters.Add("LRKLIART1", OracleType.NVarChar).Value = dwData["LRKLIART1"].ToString(); 
          or1.Parameters.Add("LRKTOLFKT1", OracleType.NVarChar).Value = dwData["LRKTOLFKT1"].ToString(); 
          or1.Parameters.Add("LRKLIART2", OracleType.NVarChar).Value = dwData["LRKLIART2"].ToString(); 
          or1.Parameters.Add("LRKTOLFKT2", OracleType.NVarChar).Value = dwData["LRKTOLFKT2"].ToString(); 
          or1.Parameters.Add("LRKLIART3", OracleType.NVarChar).Value = dwData["LRKLIART3"].ToString(); 
          or1.Parameters.Add("LRKTOLFKT3", OracleType.NVarChar).Value = dwData["LRKTOLFKT3"].ToString(); 
          or1.Parameters.Add("LRKLIART4", OracleType.NVarChar).Value = dwData["LRKLIART4"].ToString(); 
          or1.Parameters.Add("LRKTOLFKT4", OracleType.NVarChar).Value = dwData["LRKTOLFKT4"].ToString(); 
          or1.Parameters.Add("LRKFLOMIN", OracleType.NVarChar).Value = dwData["LRKFLOMIN"].ToString(); 
          or1.Parameters.Add("LRKFLOOPT", OracleType.NVarChar).Value = dwData["LRKFLOOPT"].ToString(); 
          or1.Parameters.Add("LRKFLOMAX", OracleType.NVarChar).Value = dwData["LRKFLOMAX"].ToString(); 
          or1.Parameters.Add("LRKFLOAUF", OracleType.NVarChar).Value = dwData["LRKFLOAUF"].ToString(); 
          or1.Parameters.Add("LRKFLOVST", OracleType.NVarChar).Value = dwData["LRKFLOVST"].ToString(); 
          or1.Parameters.Add("LRKLECHT", OracleType.NVarChar).Value = dwData["LRKLECHT"].ToString(); 
          or1.Parameters.Add("LRKNECHT", OracleType.NVarChar).Value = dwData["LRKNECHT"].ToString(); 
          or1.Parameters.Add("LRKVERSART", OracleType.NVarChar).Value = dwData["LRKVERSART"].ToString(); 
          or1.Parameters.Add("LRKFARBBEZ", OracleType.NVarChar).Value = dwData["LRKFARBBEZ"].ToString(); 
          or1.Parameters.Add("LRKDRKBRT", OracleType.NVarChar).Value = dwData["LRKDRKBRT"].ToString(); 
          or1.Parameters.Add("LRKLRAND", OracleType.NVarChar).Value = dwData["LRKLRAND"].ToString(); 
          or1.Parameters.Add("LRKRRAND", OracleType.NVarChar).Value = dwData["LRKRRAND"].ToString(); 
          or1.Parameters.Add("LRKPROGRP", OracleType.NVarChar).Value = dwData["LRKPROGRP"].ToString(); 
          or1.Parameters.Add("LRKARTGRP", OracleType.NVarChar).Value = dwData["LRKARTGRP"].ToString(); 
          or1.Parameters.Add("LRKKONZVON", OracleType.NVarChar).Value = dwData["LRKKONZVON"].ToString(); 
          or1.Parameters.Add("LRKKONZZU", OracleType.NVarChar).Value = dwData["LRKKONZZU"].ToString(); 
          or1.Parameters.Add("LRKNACH", OracleType.NVarChar).Value = dwData["LRKNACH"].ToString(); 
          or1.Parameters.Add("LRKFLOAUFM", OracleType.NVarChar).Value = dwData["LRKFLOAUFM"].ToString(); 
          or1.Parameters.Add("LRKFKKG", OracleType.NVarChar).Value = dwData["LRKFKKG"].ToString(); 
          or1.Parameters.Add("LRKCKKG", OracleType.NVarChar).Value = dwData["LRKCKKG"].ToString(); 
          or1.Parameters.Add("LRKFKLTR", OracleType.NVarChar).Value = dwData["LRKFKLTR"].ToString(); 
          or1.Parameters.Add("LRKCKLTR", OracleType.NVarChar).Value = dwData["LRKCKLTR"].ToString(); 
          or1.Parameters.Add("LRKFKMIN", OracleType.NVarChar).Value = dwData["LRKFKMIN"].ToString(); 
          or1.Parameters.Add("LRKCKMIN", OracleType.NVarChar).Value = dwData["LRKCKMIN"].ToString(); 
          or1.Parameters.Add("LRKFIXIERFL", OracleType.NVarChar).Value = dwData["LRKFIXIERFL"].ToString(); 
          or1.Parameters.Add("LRKBEARBZT", OracleType.NVarChar).Value = dwData["LRKBEARBZT"].ToString(); 
          or1.Parameters.Add("LRKGRUNDMG", OracleType.NVarChar).Value = dwData["LRKGRUNDMG"].ToString(); 
          or1.Parameters.Add("LRKSPEZGEW", OracleType.NVarChar).Value = dwData["LRKSPEZGEW"].ToString(); 
          or1.Parameters.Add("LRKTRKSUBST", OracleType.NVarChar).Value = dwData["LRKTRKSUBST"].ToString(); 
          or1.Parameters.Add("LRKREIFEZT", OracleType.NVarChar).Value = dwData["LRKREIFEZT"].ToString(); 
          or1.Parameters.Add("LRKMNRKRS", OracleType.NVarChar).Value = dwData["LRKMNRKRS"].ToString(); 
          or1.Parameters.Add("LRKMLFDNR", OracleType.NVarChar).Value = dwData["LRKMLFDNR"].ToString(); 
          or1.Parameters.Add("LRKMPOS", OracleType.NVarChar).Value = dwData["LRKMPOS"].ToString(); 
          or1.Parameters.Add("LRKFKMTR", OracleType.NVarChar).Value = dwData["LRKFKMTR"].ToString(); 
          or1.Parameters.Add("LRKCKMTR", OracleType.NVarChar).Value = dwData["LRKCKMTR"].ToString(); 
          or1.Parameters.Add("LRKRGBWERT1", OracleType.NVarChar).Value = dwData["LRKRGBWERT1"].ToString(); 
          or1.Parameters.Add("LRKRGBWERT2", OracleType.NVarChar).Value = dwData["LRKRGBWERT2"].ToString(); 
          or1.Parameters.Add("LRKRGBWERT3", OracleType.NVarChar).Value = dwData["LRKRGBWERT3"].ToString(); 
          or1.Parameters.Add("LRKFARBPAL", OracleType.NVarChar).Value = dwData["LRKFARBPAL"].ToString(); 
          or1.Parameters.Add("LRKFLKZ", OracleType.NVarChar).Value = dwData["LRKFLKZ"].ToString(); 
          or1.Parameters.Add("LRKFILLER2", OracleType.NVarChar).Value = dwData["LRKFILLER2"].ToString(); 
          or1.Parameters.Add("LRKLAUFKRS", OracleType.NVarChar).Value = dwData["LRKLAUFKRS"].ToString(); 
          or1.Parameters.Add("LRKLAUFLFD", OracleType.NVarChar).Value = dwData["LRKLAUFLFD"].ToString(); 
          or1.Parameters.Add("LRKLAUFPOS", OracleType.NVarChar).Value = dwData["LRKLAUFPOS"].ToString(); 
          or1.Parameters.Add("LRKVERS", OracleType.NVarChar).Value = dwData["LRKVERS"].ToString(); 
          or1.Parameters.Add("LRKAENDZL", OracleType.NVarChar).Value = dwData["LRKAENDZL"].ToString(); 
          or1.Parameters.Add("LRKAENDBEN", OracleType.NVarChar).Value = dwData["LRKAENDBEN"].ToString(); 
          or1.Parameters.Add("LRKAENDDAT", OracleType.NVarChar).Value = dwData["LRKAENDDAT"].ToString(); 
          or1.Parameters.Add("LRKNEUBEN", OracleType.NVarChar).Value = dwData["LRKNEUBEN"].ToString(); 
          or1.Parameters.Add("LRKNEUDAT", OracleType.NVarChar).Value = dwData["LRKNEUDAT"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
